package com.example.module_live

import android.app.Application
import android.util.Log
import com.hyphenate.chat.EMClient
import com.hyphenate.chat.EMOptions
import com.tencent.live2.V2TXLivePremier
import com.tencent.live2.V2TXLivePremier.V2TXLivePremierObserver
import com.tencent.rtmp.TXLiveBase


/**
 * @author yaotianxue
 * @description
 * @date 2025/3/5
 */
class App: Application() {
    override fun onCreate() {
        super.onCreate()
        val licenceURL = "https://license.vod2.myqcloud.com/license/v2/1302053459_1/v_cube.license" // 获取到的 licence url
        val licenceKey = "c5e35a3856e64fbdd07381c14e9f28de" // 获取到的 licence key
       // TXLiveBase.getInstance().setLicence(this, licenceURL, licenceKey)
        V2TXLivePremier.setLicence(this, licenceURL, licenceKey)
        V2TXLivePremier.setObserver(object : V2TXLivePremierObserver() {
            override fun onLicenceLoaded(result: Int, reason: String) {
                Log.i("TAG", "onLicenceLoaded: result:$result, reason:$reason")
            }
        })
        //环信初始化
        val options = EMOptions()
        options.setAppKey("1160220506140334#ivideo")
        EMClient.getInstance().init(this, options)

    }

}